package zhongbo.java.air.ingestion.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.listener.PatternTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.data.redis.listener.Topic;
import zhongbo.java.air.ingestion.listener.RedisSubscribeChanelListener;


@Configuration
@Slf4j
public class RedisListenConfig {
    public static String FLIGHT_PATH_CHANEL = "flight_path_chanel";
    @Autowired
    public void configlistener(RedisMessageListenerContainer listenerContainer,
                               RedisSubscribeChanelListener logChanelListener) {
        log.info("配置redis监听器");
        Topic logTopic = new PatternTopic(FLIGHT_PATH_CHANEL);
        listenerContainer.addMessageListener(logChanelListener, logTopic);
    }
}


